<?php
return [
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => '',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
                [
                    'class' => 'yii\log\FileTarget',  //Yii2处理日志的类
                    'levels' => [], //设置日志记录的级别
                    'categories' => ['adminApiLog'], //自定义日志分类
                    'maxFileSize' => 1024 * 20,  //设置文件大小，以k为单位
                    'logFile' => '@runtime/apilogs/admin_'.date('Ymd'), //自定义文件路径
                    'logVars' => [],  //捕获请求参数
                    'fileMode' => 0775, //设置日志文件权限
                    'maxLogFiles' => 100,  //同个文件名最大数量
                    'rotateByCopy' => false, //是否以复制的方式rotate
                    'prefix' => function() {   //日志格式自定义 回调
                        return "";
                    },
                ],
                [
                    'class' => 'yii\log\FileTarget',  //Yii2处理日志的类
                    'levels' => ['error', 'warning'], //设置日志记录的级别
                    'categories' => ['mysqlErrorLogs','ipLogs'], //自定义日志分类
                    'maxFileSize' => 1024 * 20,  //设置文件大小，以k为单位
                    'logFile' => '@runtime/logs/errorlogs', //自定义文件路径
                    'logVars' => [],  //捕获请求参数
                    'fileMode' => 0775, //设置日志文件权限
                    'maxLogFiles' => 100,  //同个文件名最大数量
                    'rotateByCopy' => false, //是否以复制的方式rotate
                    'prefix' => function() {   //日志格式自定义 回调
                        return "";
                    },
                ],
            ],
        ],
    ],
];
